package com.wltt.product.ahuthr.controller;

import com.wltt.product.ahuthr.model.ResultData;
import com.wltt.product.ahuthr.service.SalaryHouseFundService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
@RequestMapping(value = "/api/salaryHouseFund")
public class SalaryHouseFundController {

    @Resource
    private SalaryHouseFundService salaryHouseFundService;

    /**
     * 导入公积金
     *
     * @return
     */
    @PostMapping(value = {"/importSalaryHouseFund"})
    public ResultData importSalaryHouseFund(@RequestParam("file") MultipartFile file,
                                            @RequestParam(value = "belongYear", required = false) Integer belongYear,
                                            @RequestParam(value = "currentYear", required = false) Integer currentYear) throws IOException {
        return salaryHouseFundService.importSalaryHouseFund(file, belongYear, currentYear);
    }
}
